﻿using System;
using System.Collections.Generic;
using Unity.Entities;
using UnityEngine;

namespace LazyFramework.Game
{
    [Serializable]
    public struct ActorBase : ISharedComponentData, IEquatable<ActorBase>
    {
        public GameObject prefab;
        public int speed;
        public int count;

        public bool Equals(ActorBase other)
        {
            return
               speed == other.speed
               && count == other.count
               && prefab == other.prefab;
        }

        public override int GetHashCode()
        {
            int hash = speed.GetHashCode();
            hash ^= count.GetHashCode();
            if (!ReferenceEquals(prefab, null))
                hash ^= prefab.GetHashCode();
            return hash;
        }
    }

    public class ActorBaseComponent : SharedComponentDataProxy<ActorBase> {
    }
}
